package com.zbkj.common.request.traceability;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 追溯日志请求对象
 * +----------------------------------------------------------------------
 * | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
 * +----------------------------------------------------------------------
 * | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
 * +----------------------------------------------------------------------
 * | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
 * +----------------------------------------------------------------------
 * | Author: xiaolic
 * +----------------------------------------------------------------------
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="TraceabilityLogsRequest对象", description="追溯日志请求参数")
public class TraceabilityLogsRequest implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "日志ID，编辑时必传")
    private Long id;

    @ApiModelProperty(value = "所属批次ID", required = true)
    @NotNull(message = "批次ID不能为空")
    private Long batchId;

    @ApiModelProperty(value = "可追溯项ID")
    private Long traceableItemId;

    @ApiModelProperty(value = "日志标题", required = true)
    @NotBlank(message = "日志标题不能为空")
    private String logTitle;

    @ApiModelProperty(value = "日志内容")
    private String logContent;

    @ApiModelProperty(value = "图片地址 (URL)，多个图片地址用英文逗号分隔")
    private String imageUrl;

    @ApiModelProperty(value = "日志事件发生时间", required = true)
    @NotNull(message = "日志发生时间不能为空")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date logTime;
    
    @ApiModelProperty(value = "排序字段，值越小越靠前")
    private Integer sortOrder = 0;

    @ApiModelProperty(value = "经度")
    private String longitude;

    @ApiModelProperty(value = "纬度")
    private String latitude;

    @ApiModelProperty(value = "地名")
    private String place;

    @ApiModelProperty(value = "地址")
    private String address;

    @ApiModelProperty(value = "详细地址")
    private String details;

}
